/**
 * 
 */
package com.owen.he.jee.vo;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
public class LoadmoreResult<T> {
	private List<T> entities;
	private int currentPage;
	private int pageSize;
	
	public LoadmoreResult() {}

	public LoadmoreResult(LoadmoreParam paging, List<T> entities) {
		this.currentPage = paging.currentPage;
		this.pageSize = paging.pageSize;
		this.entities = entities;
	}
	
	public void addEntity(T t) {
		if (entities == null) {
			entities = new ArrayList<T>();
		}
		entities.add(t);
	}

	public List<T> getEntities() {
		return entities;
	}

	public void setEntities(List<T> entities) {
		this.entities = entities;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	
}